﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TryHomeTask2
{
    #region The available classes

    public interface IWord
    {
        void Print();
    }

    public interface IWord2 : IWord
    {
        new void Print();
    }

    public abstract class Base
    {
        protected static string msg = "send ";

        public Base()
        {
            Console.Write(this.GetString());
        }

        static Base()
        {
            Console.Write("Never ");
        }

        public virtual void Print()
        {
            Console.Write("to ");
        }

        protected virtual string GetString()
        {
            return "llama ";
        }
    }

    public class Derived : Base, IWord
    {

        static Derived()
        {
            Console.Write(Derived.msg);
        }

        public new virtual void Print()
        {
            Console.Write("do ");
        }

        protected override string GetString()
        {
            return "a ";
        }
    }

    public sealed class MoreDerived : Derived, IWord
    {
        public override void Print()
        {
            Console.Write("mach");
        }

        void IWord.Print()
        {
            Console.Write("a ");
        }

        protected override string GetString()
        {
            return "do ";
        }
    }

    public sealed class MoreDerived2 : Derived, IWord2
    {

        static MoreDerived2()
        {
            Console.Write("ine");
        }

        public new void Print()
        {
            Console.Write("job. ");
        }

        void IWord2.Print()
        {
            Console.Write("job.");
        }

        protected override string GetString()
        {
            return "'s ";
        }
    }

    public abstract class Unfinished : Base
    {
        protected new void Print()
        {
            Console.Write("camel ");
        }

        protected override string GetString()
        {
            return "human ";
        }
    }

    public class Finished : Unfinished
    {
    }

    #endregion
    class Program
    {
        static void Main(string[] args)
        {
            Derived d = new Derived();
            Finished f = new Finished();
            Base b = d;
            b.Print();
            Derived md = new MoreDerived();
            Base b1 = new Derived();
            md.Print();
            MoreDerived2 md2 = new MoreDerived2();
            md2.Print();
        }
    }
}
